FIG. 1 shows a construction of a multiplexed stream 10 shown, for example, in the ITU-T Recommendation H.223. Referring to FIG. 1, the stream comprises input data sequences 14 (A and B), a flag 11 that marks a separation between packets, a header 12 for packet type identification, error control and indication of the continuity of packets, and data 13 produced by splitting (packetizing) the input data sequence 14 into an appropriate length.
A description will now be given of the operation according to the related art.
FIG. 1 shows an example of transmitting a multiplexed stream 10 produced as a result of multiplexing the two input data sequences 14. In this case, the multiplexing apparatus splits the two input data sequences 14 (A and B) to have an appropriate length to produce the packet 13. The flag 11 and the header 12 indicating the data type of the packet are attached to the data 13 for transmission.
The demultiplexing apparatus receiving the multiplexed stream 10 detects the flag 11 and analyzes the header 12 that follows the flag 11 in order to identify the type of data 13. The demultiplexing apparatus assumes that the data 13 are being received until the next flag 11 is detected. The data 13 of the same data type are collected to restore the original input data sequences 14 (A and B).
A problem with the related-art demultiplexing apparatus is that, when an emulation of the flag 11 occurs as a result of a pattern identical with the flag 11 being mixed in the data 13, the pattern is misidentified as the flag 11. When this occurs, it is impossible to restore the input data 14 normally until the next flag 11 is detected properly.
Failure to identify the flag 11 also occurs when a transmission error is introduced in the multiplexed stream 10. As a result of the failure, it is impossible to restore the input data sequence 14 normally until the next flag 11 is detected properly.
Even when the flag 11 is detected, the input data sequence 14 may not be restored normally if the header 12 is misidentified due to a transmission error or the like.
The present invention has been developed with a view to resolving the above problems and has objectives of providing a multiplexing apparatus producing a multiplexed stream that is demultiplexed properly even when a flag emulation occurs or when an error in transmitting a flag or a header occurs, and providing a demultiplexing apparatus capable of demultiplexing the multiplexed stream properly.